
public abstract class Person implements Comparable<Person>{

	String name;
	
	public Person(String _name){
		this.name = _name;
	}
	
	public String getName(){
		return this.name;
	}
	
	public int compareTo(Person another){
		return this.name.compareToIgnoreCase(another.getName());
	}
	
	public boolean equals(Person obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (!(obj instanceof Person))
			return false;
		if (name == null) {
			if (obj.name != null)
				return false;
		} else if (!name.equals(obj.name))
			return false;
		return true;
	}

	public String toString(){
		return "Name ["+this.getName()+"] , a ["+this.getClass().getName()+"]";
	}
}
